package Buttons
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	/**
	 * ...
	 * @author Lokiraze
	 */
	public class NumberButton extends MovieClip
	{
		public var number:int;
		public var game:Game;
		
		public function NumberButton(i:int, g:Game)
		{
			number = i;
			game = g;
			this.Draw();
			this.addEventListener(MouseEvent.CLICK, SetNumber);
		}
		
		public function Draw()
		{
			txtNumber.text = String(number);
			txtNumber.selectable = false;
		}
		
		public function SetNumber(e:MouseEvent)
		{
			game.SetPlayerAnswer(number);			
		}
		
	}
	
}